package test;

import static org.junit.Assert.*;
import org.junit.Test;
import expression.InfixtoPostfixTranslator;

public class SaraSchlosserIPTest {
	
	@Test
	public void firstTest(){
		String answer = InfixtoPostfixTranslator.eval("1 + 2");
		//System.out.println(answer);
        assertTrue(answer.equals("1 2 +"));
	}
	
	@Test
	public void secondTest(){
		String answer = InfixtoPostfixTranslator.eval("1 * 2 + 3");
		//System.out.println(answer);
        assertTrue(answer.equals("1 2 * 3 +"));
	}
	
	@Test
	public void thirdTest(){
		String answer = InfixtoPostfixTranslator.eval("1 + 2 * 3");
		//System.out.println(answer);
        assertTrue(answer.equals("1 2 3 * +"));
	}
	
	@Test
	public void fourthTest(){
		String answer = InfixtoPostfixTranslator.eval("4 / 2 * 4 ^ 2 + 2 * 3");
		System.out.println(answer);
        assertTrue(answer.equals("4 2 / 4 2 ^ * 2 3 * +"));
	}
	
	@Test
	public void fifthTest(){
		String answer = InfixtoPostfixTranslator.eval("1 + 2 * 3 ^ 4 / 5 / 6");
		//System.out.println(answer);
        assertTrue(answer.equals("1 2 3 4 ^ * 5 / 6 / +"));
	}
	
	@Test
	public void sixthTest(){
		String answer = InfixtoPostfixTranslator.eval("( 1 + 2 ) * 3 ^ ( 4 / 5 ) / 6");
		//System.out.println(answer);
        assertTrue(answer.equals("1 2 + 3 4 5 / ^ * 6 /"));
	}
}